import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpGoodArr {
  id!: number;
  goodId!: number;
  signId?: unknown;
  stock!: number;
  kmkId?: number = 0;
  price!: string;
  linePrice!: string;
  no?: string;
  weight?: number;
  img!: unknown;
  uniacid!: number;
}

export const ImsYzdKpGoodArrSchema = new EntitySchema({
  class: ImsYzdKpGoodArr,
  properties: {
    id: { primary: true, type: 'number' },
    goodId: { type: 'number', index: 'good_id' },
    signId: { type: 'unknown', columnType: 'longtext', nullable: true },
    stock: { type: 'number' },
    kmkId: { type: 'number', nullable: true, default: 0 },
    price: { type: 'string', columnType: 'numeric(10,2)' },
    linePrice: { type: 'string', columnType: 'numeric(10,2)' },
    no: { type: 'string', length: 255, nullable: true },
    weight: { type: 'number', nullable: true },
    img: { type: 'unknown', columnType: 'longtext' },
    uniacid: { type: 'number', index: 'uniacid' },
  },
});
